<%@ Page Language="C#" MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="OrderEdit.aspx.cs"
    Inherits="OrderEdit" MaintainScrollPositionOnPostback="false" Title="<%$Resources:Language,CmsOrderEditTitle %>" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/ctrlProductChoose.ascx" TagPrefix="ctrl" TagName="ctrlProductChoose" %>
<%@ Register Src="../controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="ctrl" %>
<asp:Content ID="cOrderEdit" ContentPlaceHolderID="cphMain" runat="Server">
    <h2>
        <%=Resources.Language.OrderEdit %><asp:Label ID="lblRealizationID" runat="server"></asp:Label>
    </h2>
    <ctrl:ctrlWait ID="ctrlWait" runat="server" />
    <div id="OrderEdit">
        <asp:UpdatePanel ID="upOrderDetails" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <cc1:TabContainer ID="tcOrderEdit" runat="server" ActiveTabIndex="0" Width="100%">
                    <cc1:TabPanel ID="tpOrderDetails" runat="server" HeaderText="<%$Resources:Language,OrderDetails %>">
                        <ContentTemplate>
                            <div class="vSeparate">
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%= Resources.Language.CustomerInfo %></legend>
                                    <div>
                                        <asp:Label ID="lblName" runat="server"></asp:Label>
                                        <asp:Label ID="lblSurname" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:Label ID="lblStreet" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:Label ID="lblZipCode" runat="server"></asp:Label>
                                        <asp:Label ID="lblCity" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:Label ID="lblCountry" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <%=Resources.Language.PhoneShortcut %>
                                        <asp:Label ID="lblPhone" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <%=Resources.Language.EmailLower %>
                                        <a id="aEmail" runat="server"></a>
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox" id="fInvoiceData" runat="server">
                                    <legend>
                                        <%= Resources.Language.InvoiceData %>
                                    </legend>
                                    <div>
                                        <asp:Label ID="lblCompanyName" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:Label ID="lblCompanyStreet" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:Label ID="lblCompanyZipCode" runat="server"></asp:Label>
                                        <asp:Label ID="lblCompanyCity" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <%=Resources.Language.NIP %>
                                        <asp:Label ID="lblCompanyNIP" runat="server"></asp:Label>
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%= Resources.Language.OrderDetails %>
                                    </legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Status %>:</span><asp:Label ID="lblOrderState" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.PaymentType %>:</span><asp:Label ID="lblPaymentType" runat="server"></asp:Label>
                                    </div>
                                    <div id="dDelayedPaymentDate" runat="server">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.DelayedPaymentDate %>: </span>
                                        <asp:Label ID="lblDelayedPaymentDate" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.OrderValue %>:</span><asp:Label ID="lblOrderValue" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ShipmentCost %>:</span><asp:Label ID="lblShipmentCost" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.OrderDate %>:</span><asp:Label ID="lblStartDate" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ShipmentDate %>:</span><asp:Label ID="lblEndDate" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Invoice %>:</span><a id="aInvoice_" target="_blank" runat="server">
                                                -</a>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.InvoiceDate %>:</span><asp:Label ID="lblInvoiceDate" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Transfer %>:</span><a id="aTransfer_" target="_blank" runat="server">-</a>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.UrlReferrer %>:</span><a id="aUrlRefferer" target="_blank"
                                                runat="server"> </a>
                                        <asp:Label ID="lblUrlRefferer" runat="server" Visible="False"></asp:Label>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.PaymentReminder %>:</span>
                                        <asp:Label ID="lPaymentNotificationSent" runat="server" Text="<%$ Resources:Language,NotSent %>"></asp:Label>
                                    </div>
                                </fieldset>
                            </div>
                            <fieldset id="dOrderInfo" class="vSeparate" runat="server">
                                <legend>
                                    <%= Resources.Language.AdditionalInfo %>
                                </legend>
                                <p id="pOrderInfo" runat="server">
                                </p>
                            </fieldset>
                            <fieldset class="vSeparate">
                                <legend>
                                    <%= Resources.Language.OrderedProducts %></legend>
                                <asp:Repeater ID="rptOrderedProducts" runat="server" OnItemDataBound="rptOrderedProducts_ItemDataBound">
                                    <HeaderTemplate>
                                        <table class="cmsTables" width="100%">
                                            <tr>
                                                <th>
                                                    ID
                                                </th>
                                                <th>
                                                    <%=Resources.Language.Name %>
                                                </th>
                                                <th>
                                                    <%=Resources.Language.Status %>
                                                </th>
                                                <th>
                                                    <%=Resources.Language.Items %>
                                                </th>
                                                <th>
                                                    <%=Resources.Language.PriceBrutto %>
                                                </th>
                                                <th>
                                                    <%=Resources.Language.TotalAmountBrutto %>
                                                </th>
                                            </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr style="background-color: #F7F6F3">
                                            <td>
                                                <%# Eval("ProductID") %>
                                            </td>
                                            <td>
                                                <%# Eval("ProductName") %>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblProductStatus" runat="server"></asp:Label>
                                            </td>
                                            <td>
                                                <%# Eval("Count") %>
                                            </td>
                                            <td>
                                                <%# Eval("PriceBrutto") %>
                                            </td>
                                            <td>
                                                <%# (Container.DataItem as ShopModel.ProductBatch).PriceBrutto * (Container.DataItem as ShopModel.ProductBatch).Count%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <AlternatingItemTemplate>
                                        <tr style="background-color: #E7E6E3">
                                            <td>
                                                <%# Eval("ProductID") %>
                                            </td>
                                            <td>
                                                <%# Eval("ProductName") %>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblProductStatus" runat="server"></asp:Label>
                                            </td>
                                            <td>
                                                <%# Eval("Count") %>
                                            </td>
                                            <td>
                                                <%# Eval("PriceBrutto") %>
                                            </td>
                                            <td>
                                                <%# (Container.DataItem as ShopModel.ProductBatch).PriceBrutto * (Container.DataItem as ShopModel.ProductBatch).Count%>
                                            </td>
                                        </tr>
                                    </AlternatingItemTemplate>
                                    <FooterTemplate>
                                        <tr>
                                            <th colspan="5" class="cmsTablesFooter">
                                                <%=Resources.Language.Total %>:
                                            </th>
                                            <th align="center">
                                                <asp:Label ID="lblProductsTotalAmount" runat="server" Text="Label"></asp:Label>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="5" class="cmsTablesFooter">
                                                <%=Resources.Language.Shipment %>:
                                            </td>
                                            <td align="center">
                                                <asp:Label ID="lblShipmentCost" runat="server" Text="Label"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="5" class="cmsTablesFooter">
                                                <strong>
                                                    <%=Resources.Language.TotalPaid %>:</strong>
                                            </td>
                                            <td align="center">
                                                <strong>
                                                    <asp:Label ID="lblTotalAmount" runat="server" Text="Label"></asp:Label></strong>
                                            </td>
                                        </tr>
                                        </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </fieldset>
                        </ContentTemplate>
                    </cc1:TabPanel>
                    <cc1:TabPanel ID="tpOrderEdit" runat="server" HeaderText="<%$Resources:Language,OrderEdit %>">
                        <ContentTemplate>
                            <uc1:ctrlShowInfo ID="CtrlShowInfo" runat="server" />
                            <div>
                                <asp:Button ID="btnCancelRealizaton" runat="server" Text="<%$Resources:Language,CancelOrder %>"
                                    OnClick="btnCancelRealizaton_Click" />
                                <asp:Button ID="btnSaveRealization" runat="server" Text="<%$Resources:Language,SaveChanges %>"
                                    Font-Underline="False" OnClick="btnSaveRealization_Click" />
                                <asp:Button ID="btnCancel" runat="server" Text="<%$Resources:Language,CancelChanges %>"
                                    OnClick="btnCancel_Click" />
                                <asp:Button ID="btnDelayedPayment" runat="server" Text="<%$Resources:Language,DelayedPayment %>"
                                    OnClick="btnDelayedPayment_Click" />
                            </div>
                            <div class="vSeparate">
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.CustomerInfo%>
                                        (<asp:LinkButton ID="lnkEditClient" runat="server"><%=Resources.Language.Edit %></asp:LinkButton>)
                                    </legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.FirstName%>:</span>
                                        <asp:TextBox ID="tbFirstName" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.LastName%>:</span>
                                        <asp:TextBox ID="tbSurname" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Street%>:</span>
                                        <asp:TextBox ID="tbStreet" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ZipCode%>:</span>
                                        <asp:TextBox ID="tbZipCode" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.City%>:</span>
                                        <asp:TextBox ID="tbCity" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Country%>:</span>
                                        <asp:TextBox ID="tbCountry" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Phone%>:</span>
                                        <asp:TextBox ID="tbPhone" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Email%>:</span>
                                        <asp:TextBox ID="tbEmail" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.CompanyInfo%>
                                        (<asp:LinkButton ID="lnkEditClient2" runat="server"><%=Resources.Language.Edit %></asp:LinkButton>)
                                    </legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.CompanyName%>:</span>
                                        <asp:TextBox ID="tbCompanyName" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.NIP%>:</span>
                                        <asp:TextBox ID="tbCompanyNIP" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Street%>:</span>
                                        <asp:TextBox ID="tbCompanyStreet" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ZipCode%>:</span>
                                        <asp:TextBox ID="tbCompanyZipCode" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.City%>:</span>
                                        <asp:TextBox ID="tbCompanyCity" runat="server" ReadOnly="true" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.ShipmentAddress%>
                                    </legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.FirstName%>:</span>
                                        <asp:TextBox ID="tbADFirstName" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.LastName%>:</span>
                                        <asp:TextBox ID="tbADLastName" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Street%>:</span>
                                        <asp:TextBox ID="tbADStreet" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ZipCode%>:</span>
                                        <asp:TextBox ID="tbADZipCode" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.City%>:</span>
                                        <asp:TextBox ID="tbADCity" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Country%>:</span>
                                        <asp:DropDownList ID="ddlADCountry" runat="server" DataTextField="Name" DataValueField="IDcountry"
                                            CssClass="DropDown">
                                        </asp:DropDownList>
                                    </div>
                                </fieldset>
                            </div>
                            <div class="vSeparate">
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.RealizationDetails%>
                                    </legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.OrderValue%>:</span>
                                        <asp:Label ID="lblOrderAmount" runat="Server"></asp:Label>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.OrderDate%>:</span>
                                        <asp:TextBox ID="tbStartDate" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Accomplished%>:</span>
                                        <asp:TextBox ID="tbEndDate" runat="server" CssClass="TextInput"></asp:TextBox>
                                        <asp:CompareValidator ID="cvEndDate" runat="server" ErrorMessage="*" ControlToValidate="tbEndDate"
                                            Type="Date" Operator="DataTypeCheck"></asp:CompareValidator>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.PaymentType%>:</span>
                                        <asp:DropDownList ID="ddlPaymentType" runat="server" AutoPostBack="True" CssClass="DropDown"
                                            DataTextField="PaymentName" DataValueField="PaymentID" OnSelectedIndexChanged="ddlPaymentType_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.DelayedPaymentDate%>:</span>
                                        <asp:TextBox ID="tbDelayedPaymentDate" runat="server" CssClass="TextInput"></asp:TextBox>
                                        <asp:CompareValidator ID="cvDelayedPaymentDate" runat="server" ErrorMessage="*" ControlToValidate="tbDelayedPaymentDate"
                                            Type="Date" Operator="DataTypeCheck"></asp:CompareValidator>
                                    </div>
                                    <div id="dOnlinePayment" runat="server">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.OnlinePayment%>:</span>
                                        <asp:DropDownList ID="ddlOnlinePaymentType" runat="server" DataTextField="PaymentName"
                                            DataValueField="PaymentID" CssClass="DropDown">
                                        </asp:DropDownList>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Shipment%>:</span>
                                        <asp:DropDownList ID="ddlShipmentType" runat="server" DataTextField="ShipmentName"
                                            DataValueField="ShipmentID" CssClass="DropDown">
                                        </asp:DropDownList>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ShipmentCost%>:</span>
                                        <asp:TextBox ID="tbShipmentCost" runat="server" CssClass="TextInput"></asp:TextBox>
                                        <asp:CompareValidator ID="cvShipmentCost" runat="server" ErrorMessage="*" ControlToValidate="tbShipmentCost"
                                            Type="Double" ValueToCompare="0" Operator="GreaterThanEqual"></asp:CompareValidator>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.ShipmentRealCost%>:</span>
                                        <asp:TextBox ID="tbRealShipmentCost" runat="server" CssClass="TextInput"></asp:TextBox>
                                        <asp:CompareValidator ID="cvRealShipmentCost" runat="server" ErrorMessage="*" ControlToValidate="tbRealShipmentCost"
                                            Type="Double" ValueToCompare="0" Operator="GreaterThanEqual"></asp:CompareValidator>
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.OrderManagement%></legend>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Status%>:</span>
                                        <asp:DropDownList ID="ddlStatus" runat="server" CssClass="DropDown">
                                        </asp:DropDownList>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.PaymentReminder%>:</span>
                                        <asp:CheckBox ID="chbPaymentNotificationSend" runat="server" />
                                    </div>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.Blanks%></legend>
                                    <div>
                                        <span class="peBoxLeft"><a id="aInvoice" href="reportView.ashx" target="_blank" runat="server">
                                            <%=Resources.Language.Invoice%></a>:</span>
                                        <asp:DropDownList ID="ddlInvoiceType" runat="server" AutoPostBack="True" CssClass="DropDown"
                                            OnSelectedIndexChanged="ddlInvoiceType_SelectedIndexChanged">
                                            <asp:ListItem Text="<%$Resources:Language,Original %>" Value="Oryginal"></asp:ListItem>
                                            <asp:ListItem Text="<%$Resources:Language,Copy %>" Value="Kopia"></asp:ListItem>
                                            <asp:ListItem Text="<%$Resources:Language,OriginalAndCopy %>" Value="Oryginal+Kopia"
                                                Selected="true"></asp:ListItem>
                                            <asp:ListItem Text="<%$Resources:Language,Proforma %>" Value="Proforma"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.InvoiceDate%>:</span>
                                        <asp:TextBox ID="tbInvoiceDate" runat="server" CssClass="TextInput"></asp:TextBox>
                                        <asp:CompareValidator ID="cvInvoiceDate" runat="server" ControlToValidate="tbInvoiceDate"
                                            Type="Date" Text="*" Operator="DataTypeCheck"></asp:CompareValidator>
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft"></span>
                                        <asp:Button ID="btnGenerateNewInvoice" runat="server" Text="<%$ Resources:Language,GenerateNewInvoice %>"
                                            OnClick="btnGenerateNewInvoice_Click" />
                                    </div>
                                    <div class="vSeparate">
                                        <span class="peBoxLeft"><a id="aTransfer" href="reportView.ashx" target="_blank"
                                            runat="server">
                                            <%=Resources.Language.Transfer%></a>:</span>
                                        <asp:TextBox ID="tbTransferID" runat="server" CssClass="TextInput"></asp:TextBox>
                                    </div>
                                    <div>
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.PrintFormat%>:</span>
                                        <asp:DropDownList ID="ddlReportFormat" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlReportFormat_SelectedIndexChanged"
                                            CssClass="DropDown">
                                            <asp:ListItem>PDF</asp:ListItem>
                                            <asp:ListItem>RTF</asp:ListItem>
                                            <asp:ListItem>HTML</asp:ListItem>
                                            <asp:ListItem>MS Word</asp:ListItem>
                                            <asp:ListItem Value="MSExcel">MS Excel</asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </fieldset>
                            </div>
                            <div class="vSeparate">
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.AdditionalInfo%>
                                    </legend>
                                    <asp:TextBox ID="tbInfo" runat="server" CssClass="TextInputMultiline" TextMode="MultiLine"
                                        Height="190px"></asp:TextBox>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.VoucherGenerating%>
                                    </legend>
                                    <asp:Panel ID="pnlVouchers" runat="server" Enabled="false">
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.VoucherType %>:</span>
                                        <asp:DropDownList ID="ddlVoucherType" runat="server" CssClass="DropDown">
                                        </asp:DropDownList>
                                        <br />
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.Value %>:</span>
                                        <asp:TextBox CssClass="TextInput" runat="server" ID="tbVoucherValue"></asp:TextBox><br />
                                        <span class="peBoxLeft">
                                            <%=Resources.Language.MinVoucherValue %>:</span>
                                        <asp:TextBox CssClass="TextInput" runat="server" ID="tbVoucherMinVal"></asp:TextBox><br />
                                    </asp:Panel>
                                </fieldset>
                                <fieldset class="InlineBox">
                                    <legend>
                                        <%=Resources.Language.UsedVoucher%>
                                    </legend><span class="peBoxLeft">
                                        <%=Resources.Language.VoucherType %>:</span>
                                    <asp:Label ID="lblVoucherType" runat="server"></asp:Label>
                                    <br />
                                    <span class="peBoxLeft">
                                        <%=Resources.Language.Value %>:</span>
                                    <asp:Label ID="lblVoucherValue" runat="server"></asp:Label>
                                    <br />
                                    <span class="peBoxLeft">
                                        <%=Resources.Language.MinVoucherValue %>:</span>
                                    <asp:Label ID="lblVoucherMinVal" runat="server"></asp:Label><br />
                                    <div class="vSeparate">
                                        <asp:Label ID="lblVoucherCode" runat="server" Font-Bold="true" Style="text-align: center;
                                            padding: 0 5px 0 15px;"></asp:Label>
                                    </div>
                                </fieldset>
                            </div>
                            <fieldset class="vSeparate">
                                <legend>
                                    <%=Resources.Language.ProductsList%></legend>
                                <div>
                                    <asp:GridView ID="gvOrderedProducts" runat="server" CssClass="cmsTables" AutoGenerateColumns="False"
                                        Width="100%" OnRowDataBound="gvOrderedProducts_RowDataBound" OnSelectedIndexChanging="gvOrderedProducts_SelectedIndexChanging">
                                        <Columns>
                                            <asp:BoundField DataField="ProductID" HeaderText="ID" ReadOnly="True" />
                                            <asp:BoundField DataField="ProductName" HeaderText="<%$Resources:Language,Name %>"
                                                ReadOnly="True" />
                                            <asp:BoundField DataField="PriceBrutto" HeaderText="<%$Resources:Language,PriceBrutto %>" />
                                            <asp:BoundField DataField="CostBrutto" HeaderText="<%$Resources:Language,CostBrutto %>"
                                                ReadOnly="True" />
                                            <asp:BoundField DataField="Count" HeaderText="<%$Resources:Language,Items %>" ReadOnly="True" />
                                            <asp:BoundField DataField="AvailableCount" HeaderText="<%$Resources:Language,AvailableItems %>"
                                                ReadOnly="True" />
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    <%= Resources.Language.Status %>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblStatus" runat="server"></asp:Label>
                                                    <asp:HiddenField ID="hfStatusID" Value='<%# (int)(Container.DataItem as ShopModel.ProductBatch).Status %>'
                                                        runat="server" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField ShowSelectButton="true" SelectText="<%$Resources:Language,Choose %>" />
                                        </Columns>
                                        <SelectedRowStyle BackColor="#FFFFC0" />
                                    </asp:GridView>
                                </div>
                                <div id="dOrderedProductsManage" runat="server" class="vSeparate">
                                    <span class="peBoxHalfRight">
                                        <asp:Label ID="lProductCount" runat="server" CssClass="UpperLabel"><%= Resources.Language.ProductsCount %></asp:Label>
                                        <asp:TextBox ID="tbProductCount" runat="server" CssClass="TextInputShort">1</asp:TextBox>
                                        <asp:Button ID="btnRemoveOrderedProduct" runat="server" Text="<%$Resources:Language,Remove %>"
                                            OnClick="btnRemoveOrderedProduct_Click" />
                                        <asp:Button ID="btnCancelOrderedProduct" runat="server" Text="<%$Resources:Language,Cancel %>"
                                            OnClick="btnCancelOrderedProduct_Click" />
                                        <asp:Button ID="btnReturnOrderedProduct" runat="server" Text="<%$Resources:Language,ReturnP %>"
                                            OnClick="btnReturnOrderedProduct_Click" />
                                    </span><span class="peBoxHalfLeft"><span class="peBoxHalfRight">
                                        <asp:Label ID="lNewPrice" runat="server" CssClass="UpperLabel"><%= Resources.Language.NewPriceBrutto %></asp:Label>
                                        <asp:TextBox ID="tbNewPrice" runat="server" CssClass="TextInputShort"></asp:TextBox>
                                        <asp:Button ID="btnUpdateProductsPrice" runat="server" Text="<%$Resources:Language,Update %>"
                                            OnClick="btnUpdateProductsPrice_Click" />
                                    </span></span>
                                </div>
                                <% if (gvSpecimens.Rows.Count > 0)
                                   { %>
                                <div class="vSeparate">
                                    <asp:GridView ID="gvSpecimens" CssClass="cmsTables" runat="server" AutoGenerateColumns="false">
                                        <Columns>
                                            <asp:BoundField DataField="ProductName" HeaderText="<%$Resources:Language,Name %>" />
                                            <asp:BoundField DataField="CostNetto" HeaderText="<%$Resources:Language,Cost %>" />
                                            <asp:BoundField DataField="DeliveryID" HeaderText="<%$Resources:Language,DeliveryID %>" />
                                        </Columns>
                                    </asp:GridView>
                                </div>
                                <%} %>
                            </fieldset>
                            <fieldset class="vSeparate">
                                <legend>
                                    <%=Resources.Language.AddingProductsToOrder%></legend>
                                <div>
                                    <ctrl:ctrlProductChoose ID="ctrlNewProduct" runat="server" AutoPostBack="true" OnProductListIndexChanged="ctrlNewProduct_SelectedIndexChanged"
                                        ShowBundle="true" />
                                </div>
                                <div>
                                    <span class="peBoxLeft">
                                        <%=Resources.Language.Amount%>:</span><asp:TextBox ID="tbNewProductCount" runat="server"
                                            CssClass="TextInputShort">1</asp:TextBox>
                                    <asp:Button ID="btnAddProduct" runat="server" Text="<%$Resources:Language,AddProduct %>"
                                        OnClick="btnAddProduct_Click" />
                                </div>
                                <div class="vSeparate">
                                    <asp:GridView ID="gvAvailableProducts" runat="server" AutoGenerateColumns="False"
                                        CssClass="cmsTables" Width="100%">
                                        <Columns>
                                            <asp:BoundField DataField="ProductId" HeaderText="ID" />
                                            <asp:BoundField DataField="ProductName" HeaderText="<%$Resources:Language,Name %>" />
                                            <asp:BoundField DataField="AvailableCount" HeaderText="<%$Resources:Language,Available %>" />
                                            <asp:BoundField DataField="PriceBrutto" HeaderText="<%$Resources:Language,PriceBrutto %>"
                                                DataFormatString="{0:f02}" />
                                            <asp:BoundField DataField="CostBrutto" HeaderText="<%$Resources:Language,CostBrutto %>"
                                                DataFormatString="{0:f02}" />
                                            <asp:BoundField DataField="DeliveryID" HeaderText="<%$Resources:Language,DeliveryID %>" />
                                        </Columns>
                                    </asp:GridView>
                                </div>
                                <div>
                                    <span class="peBoxLeft"></span>
                                    <asp:Label ID="lblError" runat="server" Text="" ForeColor="red"></asp:Label>
                                </div>
                            </fieldset>
                        </ContentTemplate>
                    </cc1:TabPanel>
                    <cc1:TabPanel ID="tpLog" runat="server" HeaderText="<%$Resources:Language,RealizationLog %>">
                        <ContentTemplate>
                            <asp:GridView ID="gvLog" runat="server" AutoGenerateColumns="False" CssClass="cmsTables">
                                <Columns>
                                    <asp:BoundField DataField="Date" HeaderText="<%$Resources:Language,Date %>" />
                                    <asp:BoundField DataField="Content" HeaderText="<%$Resources:Language,Event %>" HtmlEncode="False"
                                        HtmlEncodeFormatString="False" />
                                </Columns>
                            </asp:GridView>
                        </ContentTemplate>
                    </cc1:TabPanel>
                </cc1:TabContainer>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
